﻿using System;
using System.Collections.Generic;
using System.Linq;

using System.Web.Mvc;
using Prodma.DataAccess.Database;
using Prodma.DataAccess.Models;
using Prodma.DataAccess.Helper.Enumerators;

namespace Prodma.DataAccess.DataService.ListService
{
    public class BrandList
    {
        private static DataContext context = new DataContext();

        public static SelectList GetList()
        {
            DataContext context = new DataContext();
            using (context)
            {
                var list = (from brand in context.tb_Marka
                            select brand);

                SelectList selectList = new SelectList(list.ToDictionary(x => x.ID, z => z.MarkaAdi),"Key","Value");
                return selectList;
            }
        }
    }
}
